/* Janus Chat - Version 1.0
 * Authors: Matthew Perry
 *          Michael Freid
 *          Marc Latou
 *          Richard Lee
 *
 * The Janus Chat Client is a highly secured
 * peer-to-peer chat client designed to facilitate
 * the transfer of sensitive data or as a communication
 * medium for the extra paranoid
 *
 * This file contains the header of the Chatroom class.
 * This class serves as a container for all chat room information
 * held by the server. */

#ifndef CHATROOM_H
#define CHATROOM_H

#include <string>
#include <set>
#include "cliententry.h"

using std::string;
using std::set;

class Chatroom
{
  private:
    string myId;
    set<ClientEntry> myConnectedUsersIps; 
    unsigned int maxNumUsers;
    unsigned int version; // maintains a integer that gets updated any time the chatroom changes so that associated threads know to notify their corresponding clients of a change in the chatroom list of users

  public:
    Chatroom(const string& name, const string& password, const ClientEntry& init, unsigned int numUsers); // initialUser required since no such thing as an empty chatroom

    set<ClientEntry> getMyConnectedUsersIps();
    unsigned int getVersion();

    bool addUser(const ClientEntry& user);
    bool removeUser(const ClientEntry& user);

    bool testAccess(const string& name, const string& password);
    bool isEmpty();
    bool isFull();
};

#endif
